<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/in.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="zh-CN">
<head>
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>修改姓名</title>
    <link rel="stylesheet" href="${staticPage}/css/weui.css"/>
    <link rel="stylesheet" href="${staticPage}/css/modifyName.css"/>
    <!--<link rel="stylesheet" href="css/example.css"/>-->
</head>
<script type="text/javascript">

	function showToast(){
		 $('#toast').show();
	   setTimeout(function () {
	       $('#toast').hide();
	       window.location.reload();
	       location.href="${ctx}/myInfo1.0.do";
	   }, 2000);
	}

	$(function() { 
		$(".weui_btn").click(function(){
			
			var realname=$("input[name='realname']").val();
		// 	var tel=$("input[name='tel']").val();
		// 	var birth=$("input[name='birth']").val();
		//		var code=$("input[name='code']").val();
		//		var sessionId=$("input[name='sessionId']").val();
		// 	if(isChange){
		
					
			 if(realname==""){
				alert("姓名不能为空！");
				}
			
			else{
				$.getJSON("${ctx}/user_modifyInfo.json",
						{name:realname},
				function(json){
					if(json.success){
						showToast();
						
					}
					else{
						alert(json.msg);
						}
				})
			}
		});	
	})
	
					 
		
	

</script>
<body>

    <%-- <div style="background-color: #ffffff;width: 80%;height: 40px;margin-left: 10%;margin-top: 20px;border: none">
       <span>姓名：<input type="text" name="realname" style="background-color: #ffffff;width: 80%;height: 40px;border: none;font-size: 16px" value="${current_user.realname}"></span>

    </div> --%>
    
     <div class="weui_cells weui_cell_form" style="margin-left:10%;margin-right:10%">
     <div class="weui_cell">
           <!--  <div class="weui_cell_hd"><label for="" class="weui_label"> 姓名</label></div> -->
            <div class="weui_cell_bd weui_cell_primary">
                <input class="weui_input" type="text" value="${current_user.realname}" name="realname"  placeholder="请输入姓名" />
            </div>
        </div>
        </div>
    <div class="weui_btn_area submitButton">
        <a class="weui_btn weui_btn_primary"  id="modifyButton">保存</a>
    </div>
    
      <div id="toast" style="display: none;">
            <div class="weui_mask_transparent"></div>
            <div class="weui_toast">
                <i class="weui_icon_toast"></i>
                <p class="weui_toast_content">修改成功！</p>
            </div>
        </div>
</body>
</html>